﻿<Window x:Class="ejpClient.ejpWindows.EjsOpenAssignmentWindowEX"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:ejs="clr-namespace:ejpClient.ejpWindows"
    Title="ファイルを選択して下さい"
    ResizeMode="NoResize" WindowStyle="ToolWindow" WindowStartupLocation="CenterOwner"
	Width="750" Height="600">
    <Window.Background>
        <ImageBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute" 
                           ImageSource="pack://application:,,,/imgData/bgtile.png" />
    </Window.Background>
    <Window.Resources>
        <ejs:ObservableCourseList x:Key="CourseList"/>
        <ejs:ObservableAssignmentList x:Key="AssignmentList"/>
        <ejs:CourseSqlDateConverter x:Key="SqlDateConverter"/>
        <ejs:StudyListToStudyCount x:Key="StudyCountConverter"/>
        <ejs:ejsAssignmentMetaDataToDisplayFormat x:Key="AssignmentMetaToString" />
        
    </Window.Resources>
    <Grid x:Name="LayoutRoot" Margin="15,15,15,15">
        <Rectangle Stroke="{x:Null}" Margin="0,0,0,0" RadiusX="15.5" RadiusY="15.5">
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#FF7FB2F0" Offset="0"/>
                    <GradientStop Color="#FFFAFAFA" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" 
                   Fill="#FFFFFFFF" Stroke="#FF7FB2F0" Margin="10,16,10,16" RadiusX="13.5" RadiusY="13.5"/>

        <Canvas DataContext="{Binding Path=SelectedValue, ElementName=_lv_Assignments, Mode=Default}">
            <TextBlock Width="Auto" Height="13" TextWrapping="Wrap" Text="ログイン：" Canvas.Left="445" Canvas.Top="29" FontSize="10"/>
            <TextBlock Width="Auto" Height="13" TextWrapping="Wrap" Text="" x:Name="_tb_LoginName" Canvas.Left="499" Canvas.Top="29" FontSize="10"/>
            <TextBlock Width="48" Height="16" Canvas.Left="447" Canvas.Top="54" Text="コース：" TextWrapping="Wrap"/>
            <ComboBox x:Name="_cb_Courses" Width="166.313" Height="22" Canvas.Left="499" Canvas.Top="54" IsSynchronizedWithCurrentItem="True"
                      ItemsSource="{Binding Mode=OneWay, Source={StaticResource CourseList}}" DisplayMemberPath="_name"
                      SelectionChanged="OnCourseListSelectionChanged"/>
            
            <ListView IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Mode=OneWay, Source={StaticResource AssignmentList}}"
                      x:Name="_lv_Assignments" Width="545.878" Height="178" Canvas.Left="21.435" Canvas.Top="89">
                <ListView.View>
                    <GridView>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=Title}" Header="課題名"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=studies, Converter={StaticResource StudyCountConverter}}" Header="Study数"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=OwnerName}" Header="作成者"/>
                        <GridViewColumn DisplayMemberBinding="{Binding Path=LastModifiedDate, Converter={StaticResource SqlDateConverter}}" Header="公開日時"/>
                    </GridView>
                </ListView.View>
            </ListView>
            
            <TreeView x:Name="_tv_Assignments" Background="White" Width="645.878" Height="385" Canvas.Left="21.435" 
                      Canvas.Top="89" SelectedItemChanged="_tv_Assignments_SelectedItemChanged" />
            
            <Button Width="79" Height="24.293" Content="キャンセル" Canvas.Left="588.718" 
                    Canvas.Top="481.573" Click="OnCancel" x:Name="_b_Cancel"/>
            <Button Width="106" Height="24.293" Content="開く (普通モード)" Canvas.Left="21.435" 
                    Canvas.Top="481.573" Click="OnOpenAssignment" x:Name="_b_OpenAssignment"/>
            <Button Width="133" Height="24.293" Content="開く (コメントモード)" Canvas.Left="138" 
                    Canvas.Top="481.573" Click="OnOpenAssignmentAsCA" x:Name="_b_OpenCommentedAssignment"/>
            <Button Width="133" Height="24.293" Content="コメントマージ開く" Canvas.Left="283" 
                    Canvas.Top="481.573" Click="OnMergeCommentsAndOpen" x:Name="_b_MergeAndOpen"/>
            <Button Width="79" Height="24.293" Content="削除" Canvas.Left="465" 
                    Canvas.Top="481.573" Click="OnDeleteAssignment" x:Name="_b_DeleteAssignment"/>
        </Canvas>
    </Grid>
</Window>
